package com.lipengcheng.order.config;

import com.lipengcheng.order.interceptors.Userinterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 注册拦截器
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //添加拦截器,默认是拦截所有
        registry.addInterceptor(new Userinterceptor()).addPathPatterns("/**");
    }
}
